package Calendar.table;

import javax.swing.table.AbstractTableModel;

import Calendar.table.day.DayPanel;

public class DateTableModel extends AbstractTableModel{
	
	private static final long serialVersionUID = 1L;
	
	private DayPanel[][] monthTable;
	
	/**
	 * 星期表头
	 */
	private static final String[] thead_week = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};

	public DateTableModel(DayPanel[][] monthData) {
		monthTable = monthData;
	}

	@Override
	public int getRowCount() {
		return monthTable.length;
	}

	@Override
	public int getColumnCount() {
		return thead_week.length;
	}

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
		return monthTable[rowIndex][columnIndex];
	}

	@Override
	public String getColumnName(int column) {
		return thead_week[column];
	}

	@Override
	public Class<?> getColumnClass(int columnIndex) {
		return DayPanel.class;
	}
	
}